package com.comp7940.groupf.tgbot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.comp7940.groupf.tgbot.entity.AccInfo;
import com.comp7940.groupf.tgbot.entity.User;
import com.comp7940.groupf.tgbot.mapper.AccInfoMapper;
import com.comp7940.groupf.tgbot.service.AccInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class AccInfoServiceImpl implements AccInfoService {
    @Autowired
    private AccInfoMapper aim;
    @Override
    public List<AccInfo> ps(Map<String, Object> args) {
        QueryWrapper<AccInfo> wrapper = new QueryWrapper<>();
        if (args.get("account") != null)
            wrapper.like("account", args.get("account"));
        if (args.get("email") != null)
            wrapper.like("email", args.get("email"));
        if (args.get("note") != null)
            wrapper.like("note", args.get("note"));
        return aim.selectList(wrapper);
    }
}
